package br.inf.prismasoft.academix.entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;

/**
 * Solicitacao generated by hbm2java
 */
@Name("Solicitacao")
@Entity
@Table(name = "SOLICITACAO", schema = "ACADEMIX")
public class Solicitacao implements java.io.Serializable {

	private static final long serialVersionUID = -7485563010279926364L;
	private int idtSolicitacao;
	private Aluno aluno;
	private Date datSolicitacao;

	public Solicitacao() {
	}

	public Solicitacao(int idtSolicitacao, Date datSolicitacao) {
		this.idtSolicitacao = idtSolicitacao;
		this.datSolicitacao = datSolicitacao;
	}

	public Solicitacao(int idtSolicitacao, Aluno aluno, Date datSolicitacao) {
		this.idtSolicitacao = idtSolicitacao;
		this.aluno = aluno;
		this.datSolicitacao = datSolicitacao;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "idt_solicitacao", unique = true, nullable = false)
	public int getIdtSolicitacao() {
		return this.idtSolicitacao;
	}

	public void setIdtSolicitacao(int idtSolicitacao) {
		this.idtSolicitacao = idtSolicitacao;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ind_aluno")
	public Aluno getAluno() {
		return this.aluno;
	}

	public void setAluno(Aluno aluno) {
		this.aluno = aluno;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "dat_solicitacao", nullable = false, length = 19)
	@NotNull
	public Date getDatSolicitacao() {
		return this.datSolicitacao;
	}

	public void setDatSolicitacao(Date datSolicitacao) {
		this.datSolicitacao = datSolicitacao;
	}

}
